package xyf.p11.other.bit;

/**
 * ClassName: M1704_LostNumber
 * Description:
 * Author: xyf
 * Date: 9/9/22 10:14 AM
 * Version: 1.0
 **/
public class M1704_LostNumber
{
    public int missingNumber(int[] nums)
    {
        int cur = 0;
        for (int i = 0; i < nums.length; i++)
        {
            cur = cur ^ nums[i];
        }
        for (int i = 0; i <= nums.length; i++)
        {
            cur = cur ^ i;
        }
        return cur;
    }
}
